package cn.zyq.ykb.beans.admin;

import cn.zyq.ykb.system.common.BaseBean;
import cn.zyq.ykb.system.common.Operator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 管理员表
 * 2021-04-22 17:09:21
 */
@Data
@Entity
@Table(name = "`admin`")
public class Admin extends BaseBean implements Operator, Serializable {

    private static final long serialVersionUID = 8215376405894527634L;

    /**
     * 主键id，用于关联
     */
    @Id
    @Column(name = "`adminID`")
    @ApiModelProperty("主键id，用于关联")
    private Integer id;

    /**
     * 登录凭证，每次重新登录，都更换
     */
    @Column(name = "`token`")
    @ApiModelProperty("登录凭证，每次重新登录，都更换")
    private String token;

    /**
     * 用户名
     */
    @Column(name = "`uname`")
    @ApiModelProperty("用户名")
    private String uname;

    /**
     * 手机号登录所用
     */
    @Column(name = "`phone`")
    @ApiModelProperty(value = "手机号登录所用", required = true)
    private String phone;

    /**
     * 头像
     */
    @Column(name = "`avatar`")
    @ApiModelProperty(value = "头像", required = true)
    private String avatar;

    /**
     * 登录密码
     */
    @Column(name = "`pwd`")
    @ApiModelProperty("登录密码")
    private String pwd;

    /**
     * 32位密码盐值
     */
    @Column(name = "`salt`")
    @ApiModelProperty(value = "32位密码盐值", hidden = true)
    private String salt;

    /**
     * 账号
     */
    @Column(name = "`account`")
    @ApiModelProperty("账号")
    private String account;

    @Transient
    @ApiModelProperty(hidden = true)
    private Long lastClickTime;
}
